package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityInputPwdBinding;
import flc.ast.utils.Content;
import flc.ast.view.PasscodeView;
import stark.common.basic.utils.SPUtil;

public class InputPwdActivity extends BaseAc<ActivityInputPwdBinding> {


    @Override
    protected int onCreate() {
        return R.layout.activity_input_pwd;
    }

    @Override
    protected void initView() {
        mDataBinding.ivInputPwdBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        mDataBinding.passcodeView.setListener(new PasscodeView.PasscodeViewListener() {
            @Override
            public void onFail() {
                mDataBinding.passcodeView.getWrongStatusColor();
            }

            @Override
            public void onSuccess(String number) {
                startActivity(PriVideoActivity.class);
                finish();
            }
        });
        mDataBinding.passcodeView.setMyClickListener(new PasscodeView.MyClickListener() {
            @Override
            public void click() {
                startActivity(ChangePwdActivity.class);
                finish();
            }
        });
    }

    @Override
    protected void initData() {
        String password = SPUtil.getString(mContext, Content.myPassword, "");
        mDataBinding.passcodeView.setLocalPasscode(password);
    }

    @Override
    protected void onResume() {
        super.onResume();

    }

}